package com.jai.oa.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jai.oa.mapper.TimeLogMapper;
import com.jai.oa.domain.TimeLog;
import com.jai.oa.service.ITimeLogService;

/**
 * TimeLogService业务层处理
 * 
 * @author hlzhang
 * @date 2024-09-25
 */
@Service
public class TimeLogServiceImpl implements ITimeLogService 
{
    @Autowired
    private TimeLogMapper timeLogMapper;

    /**
     * 查询TimeLog
     * 
     * @param id TimeLog主键
     * @return TimeLog
     */
    @Override
    public TimeLog selectTimeLogById(Long id)
    {
        return timeLogMapper.selectTimeLogById(id);
    }

    /**
     * 查询TimeLog列表
     * 
     * @param timeLog TimeLog
     * @return TimeLog
     */
    @Override
    public List<TimeLog> selectTimeLogList(TimeLog timeLog)
    {
        return timeLogMapper.selectTimeLogList(timeLog);
    }

    /**
     * 新增TimeLog
     * 
     * @param timeLog TimeLog
     * @return 结果
     */
    @Override
    public int insertTimeLog(TimeLog timeLog)
    {
        timeLog.setCreateTime(DateUtils.getNowDate());
        return timeLogMapper.insertTimeLog(timeLog);
    }

    /**
     * 修改TimeLog
     * 
     * @param timeLog TimeLog
     * @return 结果
     */
    @Override
    public int updateTimeLog(TimeLog timeLog)
    {
        timeLog.setUpdateTime(DateUtils.getNowDate());
        return timeLogMapper.updateTimeLog(timeLog);
    }

    /**
     * 批量删除TimeLog
     * 
     * @param ids 需要删除的TimeLog主键
     * @return 结果
     */
    @Override
    public int deleteTimeLogByIds(Long[] ids)
    {
        return timeLogMapper.deleteTimeLogByIds(ids);
    }

    /**
     * 删除TimeLog信息
     * 
     * @param id TimeLog主键
     * @return 结果
     */
    @Override
    public int deleteTimeLogById(Long id)
    {
        return timeLogMapper.deleteTimeLogById(id);
    }
}
